<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>添加教师用户</title>
<style type="text/css">
body,td,th {
	font-family: Arial, Helvetica, sans-serif;
	margin:0px;
}
.list_content {
	background-color: #fff;
	color:#73938E;
	font-size:12px;
	line-height:15px;
	text-align:center;
}
.list_top_title {
	font-size:12px;
	background-color: #F3F8F7;
	color:#73938E;
	font-weight:bold;
	line-height:30px;
	text-align:center;
	white-space: normal;
	display: block;
	border-top-style: none;
	border-right-style: none;
	border-bottom-style: none;
	border-left-style: none;
}

.STYLE1 {color: #F3F8F7}
</style>
<script src="../js/Calendar.js" language="javascript"></script>
<script src="../js/ajax.js" language="javascript"></script>
</head>
<body>
<TABLE cellSpacing=0 cellPadding=0 width="100%" align=center border=0>
  <TR height=28 >
    <TD background=../images/title_bg1.jpg>-->当前位置:添加教师用户</TD>
</TR>
<tr>
<td>&nbsp;</td>
</tr>
</TABLE>

<table width="50%" border="1" align="center"  cellpadding="3" cellspacing="0" bordercolor="#F3F8F7">
  <tr>
    <td class="list_top_title" >用户名：</td>
    <td class="list_content" ><input title="请输入6-20位之间的用户名" type="text" id="username" onchange="getData('../teacher/checkinfo.php?type=username&amp;id='+this.value,'usernamemsg');"/><span id="usernamemsg"></span>      </td>
  </tr>
  <tr>
    <td class="list_top_title">密&nbsp;&nbsp;码：</td>
    <td class="list_content"><input type="password" title="请输入6-20位之间的密码"  id="password" onchange="getData('../teacher/checkinfo.php?type=password&amp;id='+this.value,'passwordmsg');"/><span id="passwordmsg"></span></td>
  </tr>
  <tr>
    <td class="list_top_title">身份证号码：</td>
    <td class="list_content"><input title="请输入18位身份证号码" maxlength="18"  type="text" id="idcard" onchange="getData('../teacher/checkinfo.php?type=idcard&amp;id='+this.value,'idcardmsg');"/><span id="idcardmsg"></span>      </td>
  </tr>
  <tr>
   	<td colspan="2" ><div align="center"><span id="submitmsg">
  	  <input type="submit" name="submit" value="提交"  onclick="submitform()"/>
	  <input type="reset" name="cancel" value="取消"   /></span>
    </div></td>
  </tr>
</table>

</div>
<script type="text/javascript">
	
	function submitform(){
		//获取用户填写信息
		username = document.getElementById('username').value;
		password = document.getElementById('password').value;
		idcard = document.getElementById('idcard').value;
		
		//首先检测用户名密码是否正确
		usernamemsg = document.getElementById('usernamemsg').innerHTML;
		passwordmsg = document.getElementById('passwordmsg').innerHTML;
		idcardmsg = document.getElementById('idcardmsg').innerHTML;
		sumbitmsg=0;
		
		if(usernamemsg.indexOf('right')>0 && passwordmsg.indexOf('right')>0 && idcardmsg.indexOf('right')>0){
			sumbitmsg=1;
		}else{
			sumbitmsg=0;
		}
		
		if('1'==sumbitmsg){
			ajaxurl='../teacher/AddUser.php?username='+username+'&password='+password+'&idcard='+idcard;
			getData(ajaxurl,'submitmsg');
		}
	}
</script>
</body>
</html>
